package ma.ensao.egicom.core.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.scub.foundation.framework.core.model.BaseModel;

@Entity
@Table(name = "category", schema = "public")
public class Category extends BaseModel {
    /**
     * 
     */
    private static final long serialVersionUID = 7699439861081917618L;

    @Column(name = "name", length = 25)
    private String name;

    @Column(name = "description")
    private String description;

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "categoryid", referencedColumnName = "ID")
    private Set<Product> products = new HashSet<Product>(0);

    public Category() {
    }

    public Category(String name, String description, Set<Product> products) {
        super();
        this.name = name;
        this.description = description;
        this.products = products;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Set<Product> getProducts() {
        return this.products;
    }

    public void setProducts(Set<Product> products) {
        this.products = products;
    }

    @Override
    public boolean equals(Object other) {
        // TODO Auto-generated method stub
        return false;
    }

}
